//
//  MyCell.m
//  AOEProject
//
//  Created by techplus on 9/21/12.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#import "MyCell.h"

@implementation MyCell
@synthesize myCellTitle;
@synthesize myCellDate;
@synthesize myCellType;
@synthesize myCellUIImage;
@synthesize UIViewBackground;

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // Initialization code
        [self setBackgroundColor:[UIColor clearColor]];
        [self setBackgroundView:nil];
    }
    return self;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

-(void)loadImage:(NSString *)url{
    NSData *imageData = [[NSData alloc]initWithContentsOfURL:[NSURL URLWithString:url]];
    UIImage *image = [[[UIImage alloc]initWithData:imageData]autorelease];
    [imageData release];
    [self performSelectorOnMainThread:@selector(displayImageURL:) withObject:image waitUntilDone:NO];
}
     
-(void)displayImageURL:(UIImage *)image{
    [myCellUIImage setImage:image];
}


- (void)dealloc {
    [myCellTitle release];
    [myCellDate release];
    [myCellType release];
    [myCellUIImage release];
    [UIViewBackground release];
    [super dealloc];
}
@end
